<?php
/**
 * 用户登录视图
 */
// 页面标题已在控制器中设置
include '/www/wwwroot/MA.com/includes/header.php';
?>

<div class="row justify-content-center py-4">
    <div class="col-md-5">
        <div class="card shadow-sm">
            <div class="card-header">
                <h4 class="mb-0"><i class="fas fa-sign-in-alt"></i> 用户登录</h4>
            </div>
            <div class="card-body">
                <?php if (isset($error)): ?>
                    <div class="alert alert-danger"><?php echo $error; ?></div>
                <?php endif; ?>
                
                <form method="POST" action="/login.php" class="needs-validation" novalidate>
                    <div class="mb-3">
                        <label for="identity" class="form-label">用户名/邮箱/手机号</label>
                        <input type="text" class="form-control" id="identity" name="identity" value="<?php echo isset($identity) ? htmlspecialchars($identity) : ''; ?>" required>
                        <div class="invalid-feedback">
                            请输入用户名、邮箱或手机号
                        </div>
                    </div>
                    
                    <div class="mb-3">
                        <label for="password" class="form-label">密码</label>
                        <input type="password" class="form-control" id="password" name="password" required>
                        <div class="invalid-feedback">
                            请输入密码
                        </div>
                    </div>
                    
                    <div class="mb-3 form-check">
                        <input type="checkbox" class="form-check-input" id="remember" name="remember">
                        <label class="form-check-label" for="remember">记住我</label>
                    </div>
                    
                    <div class="d-grid gap-2">
                        <button type="submit" class="btn btn-primary">登录</button>
                    </div>
                </form>
            </div>
            <div class="card-footer text-center">
                <p class="mb-0">还没有账号？<a href="/register.php">立即注册</a></p>
            </div>
        </div>
    </div>
</div>

<?php include '/www/wwwroot/MA.com/includes/footer.php'; ?>
